package com.youlv.yl.dao;

import com.youlv.yl.dto.CartDetailDto;
import com.youlv.yl.entity.hotel.Cart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author fenghe
 * @since 2022-01-17
 */
@Repository
public interface CartDao extends BaseMapper<Cart> {
    @Select("select c.*, ci.gid, ci.num, ci.joinPrice, ci.id ciid from t_cart c left join t_cart_item ci on c.id = ci.cid where c.uid = #{uid}")
    List<CartDetailDto> selectMy(Long uid);
}
